﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Exp
{
    class ConsoleHS
    {
        [DllImport("user32.dll", EntryPoint = "ShowWindow", SetLastError = true)]
        public static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow);
        [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
        public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    }
    class Program
    {
        static public void SetSettingString()
        {
            StreamReader stream;
            if(File.Exists("config.txt"))
            {
                stream = new StreamReader(new FileStream("config.txt", FileMode.Open, FileAccess.Read, FileShare.Read));
                Setting.AutoImage = stream.ReadLine();
                Setting.HtmlSite = stream.ReadLine();
                stream.Close();
            }
            else
            {
                stream = new StreamReader(new FileStream("config.txt", FileMode.CreateNew, FileAccess.ReadWrite, FileShare.ReadWrite));
                Setting.AutoImage = "";
                Setting.HtmlSite = "";
                stream.Close();
            }
        }
        [STAThread]
        static void Main()
        {
            SetSettingString();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Exp());
        }
    }
}
